package com.example.aixiangshou.runninggame;

import android.content.Intent;
import android.os.Bundle;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;
import android.widget.TextView;

import com.x_memteor.base_master.base.BaseActivity;
import com.x_memteor.base_master.utils.LogUtils;
import com.x_memteor.base_master.utils.Util;

import butterknife.BindView;

public class MainActivity extends BaseActivity {

    @BindView(R.id.imv_left)
    ImageView imvLeft;
    @BindView(R.id.imv_center)
    TextView imvCenter;
    @BindView(R.id.imv_right)
    ImageView imvRight;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    public void initRootView() {
        setContentView(R.layout.activity_main);
    }

    @Override
    public void initView() {
        Util.setText(MainActivity.this, imvCenter);

        LogUtils.print("热修复");
        Animation animation = AnimationUtils.loadAnimation(MainActivity.this, R.anim.translate_down);
        imvLeft.startAnimation(animation);
        Animation animation2 = AnimationUtils.loadAnimation(MainActivity.this, R.anim.translate_up);
        imvRight.startAnimation(animation2);
        Animation animation3 = AnimationUtils.loadAnimation(MainActivity.this, R.anim.alpha_in);
        imvCenter.startAnimation(animation3);

        animation.setAnimationListener(new Animation.AnimationListener() {
            @Override
            public void onAnimationStart(Animation animation) {

            }

            @Override
            public void onAnimationEnd(Animation animation) {
                startActivity(new Intent(MainActivity.this, Main2Activity.class));
                finish();
            }

            @Override
            public void onAnimationRepeat(Animation animation) {

            }
        });
    }

    @Override
    public void initData() {

    }

    @Override
    public void initListener() {

    }
}
